<?php 
defined('RUN_KATANA') or die('Restricted access');
if(!defined('AJAX_RUN'))
{ echo $commander->getListCommandsPanel('sa', ''); }
if(is_object($adc->getCurrentAdBrand())):
?>
<fieldset class="edit_form">
	<label for="Title"><?php echo ucfirst($txt->getWord('title')); ?></label>
    <?php echo $commander->getErrorField('Title'); ?>
    <?php echo $commander->getInfoField('Title'); ?>
    <input id="Title" name="Title" class="medium" type="text" value="<?php echo $adc->CurrentAdBrand->getTitle(); ?>" maxlength="80" />
	
	<label for="TypeId"><?php echo ucfirst($txt->getWord('ad_type')); ?></label>
    <?php echo $commander->getErrorField('TypeId'); ?>
    <?php echo $commander->getInfoField('TypeId'); ?>
    <select id="TypeId" class="medium" name="TypeId">
        <option value="0" <?php echo getIsSelectedHTML($adc->CurrentAdBrand->getTypeId(), 0); ?>><?php echo ucfirst($txt->getWord('all')); ?></option>
        <?php 
        if($adc->getAdTypes())
        {
            foreach($adc->getAdTypes() as $type)
            { echo '<option value="'.$type->getId().'" '.getIsSelectedHTML($adc->CurrentAdBrand->getTypeId(), $type->getId()).'>'.$type->getTitle().'</option>'; }
        }
        ?>
    </select>
	
	<label for="CatId"><?php echo ucfirst($txt->getWord('parent').' '.$txt->getWord('ad_category')); ?></label>
    <?php echo $commander->getErrorField('CatId'); ?>
    <?php echo $commander->getInfoField('CatId'); ?>
    <select id="CatId" class="medium" name="CatId">
		<?php 
        echo '<option value="0" '.$txt->getIsSelectedHTML($adc->CurrentAdBrand->getCatId(), 0) .'>'.ucfirst($txt->getWord('all')).'</option>';
        if($adc->getAdCats())
        {
            foreach($adc->getAdCats() as $adcat)
            { 
                if($adc->CurrentAdBrand->getTypeId() > 0)
                {
                    if($adc->CurrentAdBrand->getTypeId() == $adcat->getTypeId())
                    { echo '<option value="'.$adcat->getId().'" '.$txt->getIsSelectedHTML($adc->CurrentAdBrand->getCatId(), $adcat->getId()) .'>'.$adcat->getTitle().'</option>'; }
                }
                else
                { echo '<option value="'.$adcat->getId().'" '.$txt->getIsSelectedHTML($adc->CurrentAdBrand->getCatId(), $adcat->getId()) .'>'.$adcat->getTitle().'</option>'; }
            }
        }
        ?>
    </select>
    
	<label for="ImageUpload"><?php echo ucfirst($txt->getWord('image')); ?></label>
	<?php echo $commander->getErrorField('Image'); ?>
    <?php echo $commander->getInfoField('Image'); ?>
	<?php if($adc->CurrentAdBrand->getImage() != ''):  ?>
	<img src="<?php echo $adc->CurrentAdBrand->getImageURL(); ?>" />&nbsp;&nbsp;
	<a onmousedown="jQuery('#ImageDelete').val(1);"><img title="<?php echo ucfirst($txt->getWord('delete').' '.$txt->getWord('image')); ?>" class="icon command" src="<?php echo SYSICONS_URL; ?>delete_16.gif" /></a><br />
	<input id="ImageDelete" type="hidden" id="ImageDelete" name="ImageDelete" value="0" /><br />
	<?php endif;  ?>
    <label for="Description"><?php echo ucfirst($txt->getWord('description')); ?></label>
    <?php echo $commander->getErrorField('Description'); ?>
    <?php echo $commander->getInfoField('Description'); ?>
    <textarea id="Description" name="Description" class="medium limit_500" rows="10" cols="6"><?php echo $adc->CurrentAdBrand->getDescription(); ?></textarea>
</fieldset>
<?php endif; ?>